package com.fyzk.activity.lottery.basketball.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.fyzk.adapter.JCLQDXFAdapter;
import com.fyzk.model.JCLQMatchData;
import com.fyzk.utils.LotteryIDUtils;

/**
 * 大小分玩法
 *
 * @author miao
 */
public class BasketballDXFFragment extends BasketballWFBaseFragment {


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        return super.onCreateView(inflater, container, savedInstanceState);
    }

    @Override
    public String getTextStr() {
        // TODO Auto-generated method stub
        return "大小分";
    }

    @Override
    protected int getLotteryId() {
        // TODO Auto-generated method stub
        return LotteryIDUtils.JLDXF_LOTTERY_ID_INT;
    }


    @Override
    protected void adapterChange() {
        // TODO Auto-generated method stub
        // super.adapterChange(infos);
        if (adapter == null) {
            adapter = new JCLQDXFAdapter(getActivity(), infos);
            if (adapter != null) {
                adapter.setOnJCLQTongJiListener(activity);
            }
            exListView.setAdapter(adapter);
            for (int i = 0; i < adapter.getGroupCount(); i++) {
                exListView.expandGroup(i);
            }
        } else {
            adapter.notifyDataSetChanged();
        }
    }

    @Override
    public int countChangCi() {
        // TODO Auto-generated method stub
        int changCi = 0;
        for (int i = 0; i < infos_all.size(); i++) {

            for (int j = 0; j < infos_all.get(i).matchDatas.size(); j++) {
                JCLQMatchData data = infos_all.get(i).matchDatas.get(j);
                if (data.clickNum > 0) {
                    changCi++;
                }
            }
        }
        return changCi;
    }

}
